package com.HMS.controller;


import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.HMS.pojo.User;
import com.HMS.service.UserService;
import com.HMS.service.VerifyService;

@Controller
@RequestMapping("/outLogin")
public class OutLogin {
	@Resource
	private VerifyService verifyService;
	@Resource
	private UserService userService;
	@RequestMapping("/register")
	public boolean register(User user){
		
	return	userService.userRegister(user);
		//System.out.println(name);
	}
	@ResponseBody
	@RequestMapping("/verifyEmail.action")
	public Boolean verityEmail(User user,HttpServletResponse response){
		return verifyService.emailVerify(user);
//		try {
//			response.getWriter().print(verifyService.emailVerify(email));
//		} catch (IOException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
	}
	
}
